package com.atguigu.mapreduce.demo.outputformat;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 * @version V1.0
 * @author: guangcheng
 * @date: 2021/11/30 18:09
 * @description:
 */
public class LogMapper extends Mapper<LongWritable, Text, Text, NullWritable> {


    /**
     * http://www.atguigu.com
     * http://www.sohu.com
     *
     *
     * @param key
     * @param value
     * @param context
     * @throws IOException
     * @throws InterruptedException
     */
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {

        //无需特殊处理, 直接丢出去即可  (http://www.atguigu.com, null)
        context.write(value, NullWritable.get());
    }
}

